package cn.gailvlun.gll.util;

import android.media.MediaPlayer;

import java.io.IOException;



public class AudioUtil {
    
    public static long getDuration(String url) {
        long duration = 0;
        try {
            MediaPlayer mp = new MediaPlayer();
            mp.setDataSource(url);
            mp.prepare();
            duration = mp.getDuration();
            mp.release();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return duration;
    }
}
